<div class="form">
<?php $optionlist = array('keyword','layout','description');?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'post-model-form',
	'enableAjaxValidation'=>false,
)); ?>
          
	<p class="note">Fields with <span class="required">*</span> are required.</p>
        <div class="row">
                  <b>This page was create by <?php echo Yii::app()->user->name?>.</b>
         </div>
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php
        $this->widget('application.extensions.cleditor.ECLEditor', array(   
            'model'=>$model,
            //'id'=>'content',
            'attribute'=>'content',
            'options'=>array(
            'width'=>950,
            'height'=>450,
            'useCSS'=>true,
        ),
            'value'=>$model->content,
        ));
        
        ?>
		<?php echo $form->error($model,'content'); ?>
	</div>
       

<!--	<div class="row">-->
		<?php //echo $form->labelEx($model,'tags'); ?>
		<?php //echo $form->textArea($model,'tags',array('rows'=>6, 'cols'=>50)); ?>
		<?php //echo $form->error($model,'tags'); ?>
<!--	</div>-->

	<div class="row">
		<?php echo $form->labelEx($model,'post_status'); ?>
		<?php echo $form->dropDownList($model, 'post_status',Common::getOptionValue('poststatus')); ?>
		<?php echo $form->error($model,'post_status'); ?>
	</div>

	<div class="row">
		<?php echo $form->hiddenField($model,'create_time',array('value'=>date('Y-m-d H:i:s'))); ?>
	</div>

	<div class="row">
		<?php echo $form->hiddenField($model,'update_time',array('value'=>date('Y-m-d H:i:s'))); ?>
	</div>
	

	<div class="row">
		<?php echo $form->labelEx($model,'post_type'); ?>
		<?php echo $form->textField($model,'post_type',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'post_type'); ?>
	</div>

	<div class="row">
		<?php echo $form->hiddenField($model,'post_order'); ?>
                                   <?php echo $form->hiddenField($model, 'author_id',array('value'=>Yii::app()->user->id)); ?>
            
	</div>
                  <div class="row buttons">
                      <?php foreach($optionlist as $row){
                                    echo CHtml::label($row,'label'); 
		 echo CHtml::textField("option[$row]"); 
                      }?>
                          <?php //echo CHtml::textField('option[keyword]'); ?>
                      
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
 <div class="row">
            <?php $this->widget('application.components.imageupload.UploadToPost'); ?>
        <?php
//$this->widget('zii.widgets.jui.CJuiTabs', array(
//    'tabs'=>array(
//        'From Directory'=>array('content'=>'Content for tab 2', 'id'=>'tab2'),
//        'From Directory'=>$this->renderPartial('post/_test',null,true),
//         panel 3 contains the content rendered by a partial view
//        'From Upload'=>$this->renderPartial('post/_test',null,true),
//    ),
//    // additional javascript options for the tabs plugin
//    'options'=>array(
//        'collapsible'=>true,
//    ),
//));

?>
            </div>